package com.lsc.www.day09;

public class ExceptionTest05 {
    public static void main(String[] args) {
        try {
            sub();
        } catch (NullPointerException ne){
            System.out.println("空指针异常");
        } catch (ArithmeticException ae){
            System.out.println("除数不能为0");
        } catch (Exception e){
            System.out.println("我啥都可以处理");
        } finally {
            System.out.println("我是最终值");
        }

    }

    public static void sub() throws ArithmeticException{
        int a = 10;
        int b = 0; //除数不能为0
        int c = a/b;
    }
}
